<template>
  <div>
    <div class="itemscene">
      <div class="wrap-box2 "
           :style="styleSelf"
           @click="handleHost">
        <van-icon name="wap-home-o"
                  size="large"
                  class="icon-scene" />
        <div class="text-scene">
          {{data.status}}
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'SmartScene',
  props: {
    data: {
      type: Object,
      default () {
        return {}
      }
    }
  },
  data () {
    return {
      styleSelf: 'background-color:rgba(238, 238, 238, 0.808);'
    }
  },
  methods: {
    handleHost () {
      if (this.styleSelf === 'background-color:rgba( 178, 245, 247, 0.808)') {
        this.styleSelf = 'background-color:rgba(238, 238, 238, 0.808)'
      } else {
        this.styleSelf = 'background-color:rgba( 178, 245, 247, 0.808)'
      }
    }
  }
}
</script>
<style scoped>
.wrap-box2 {
  position: relative;
  width: 100px;
  height: 40px;
  border-radius: 15px;
  background-color: rgba(238, 238, 238, 0.808);
  font-size: 16px;
  z-index: 999;
}
.icon-scene {
  position: absolute;
  top: 10px;
  left: 15px;
}
.text-scene {
  position: absolute;
  top: 8px;
  left: 40px;
}
</style>
